package com.dragon.myapplication.padings;

import androidx.lifecycle.LiveData;
import androidx.paging.DataSource;
import androidx.room.Dao;
import androidx.room.Insert;
import androidx.room.Query;

import java.util.List;

import io.reactivex.Completable;

@Dao
public interface StudentDao {
    @Insert
    Completable insertStudent(Student...students);

    @Query("DELETE FROM student_table")
    Completable deleteAllStudents();

    @Query("SELECT * FROM student_table ORDER BY id")
    //引入Paging的DataSource
    DataSource.Factory<Integer,Student> getAllStudent();
}
